﻿using System;

namespace KouDai.Core.Helper
{
    public abstract class DisposableObject : IDisposable
    {

        private bool _isDisposed;

        protected DisposableObject()
        {

        }

        public void Dispose()
        {
            if (_isDisposed)
            {
                return;
            }
            try
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
            finally
            {
                _isDisposed = true;
            }
        }

        protected abstract void Dispose(bool disposing);
    }
}
